$(function () {

    var send_email_url = '/community/send_email';
    $('#submit').click(function () {
        var verifyCodeActual = $('#j_captcha').val();
        if (!verifyCodeActual) {
            alert('请输入验证码');
            return;
        }
        var formData = new FormData();
        formData.append("verifyCodeActual", verifyCodeActual);
        formData.append('email', $('#email').val());
        $.ajax({
            url : send_email_url,
            type : 'POST',
            data : formData,
            contentType : false,
            processData : false,
            cache : false,
            success : function(data) {
                if (data.success) {
                    alert('邮件发送成功,请查收邮件并进行更改密码操作');
                } else {
                    alert(data.errMsg);
                    // $('#captcha_img').click();
                }
            }
        });
    });
});
